package Controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;

import model.Aap;
import Datalayer.AapDatalayer;
import View.AapView;

public class AapController implements ActionListener{
		
	private Aap aap1;
	private Aap aap2;
	private Aap aap3;
	
	public AapController(Aap vrouw_aap, Aap man_aap, Aap zuigeling) {
		
		this.aap1 = vrouw_aap;
		this.aap2 = man_aap;
		this.aap3 = zuigeling;
	}

	public void actionPerformed(ActionEvent e) {
		if("Voortplanten".equals(e.getActionCommand())){
			if(aap1.Voortplanten(aap2) == true){
				
				final ImageIcon icon = new ImageIcon("C:\\Users\\verawesley\\Downloads\\monkey-fuck.gif");
		        JOptionPane.showMessageDialog(null, "", "Je aap is zwanger", JOptionPane.INFORMATION_MESSAGE, icon);
					
			}
			else{
				JOptionPane.showMessageDialog(null, "Poging op zwangerschap mislukt.");
			}
		}
		if("Verzorgen".equals(e.getActionCommand())){
			if(aap1.Verzorgen(aap3)){
				
				final ImageIcon icon = new ImageIcon("C:\\Users\\verawesley\\Downloads\\monkey-washing-cat.gif");
		        JOptionPane.showMessageDialog(null, "", "Je zuigeling is schoon", JOptionPane.INFORMATION_MESSAGE, icon);
								
			}
			else{
				JOptionPane.showMessageDialog(null, "Je zuigeling hoeft niet te worden verzorgt");
			}
		}
		if("Bevallen".equals(e.getActionCommand())){
			if(aap1.Bevallen()){		
				AapDatalayer adl = new AapDatalayer();
				final ImageIcon icon = new ImageIcon("C:\\Users\\verawesley\\Downloads\\lifebirthofmonkey.gif");
		        JOptionPane.showMessageDialog(null, "", "Je aap is bevallen", JOptionPane.INFORMATION_MESSAGE, icon);
		        adl.Bevallen();
		        adl.Bevallen1();
			}
			else{
				JOptionPane.showMessageDialog(null, "Je aap heeft een miskraam");
			}
		}
		
		
		
	}
}
